<template>
  <div class="blog-toc-container">
    <h2>目录</h2>
    <RightList :list="toc" @select="handleSelect"></RightList>
  </div>
</template>

<script>

import RightList from "@/views/Blog/components/RightList.vue";

export default {
  name: "BlogTOC",
  components: {RightList},
  props: {
    toc: {
      type: Array,
      required: true
    }
  },
  methods: {
    handleSelect(item) {
      location.hash = item.anchor
    }
  }
}
</script>

<style scoped lang="less">
.blog-toc-container{
}
</style>